package xyz.liut.onmyojihelper.util

import android.os.Handler
import android.os.Message
import java.lang.ref.WeakReference


/**
 * Created by liut on 17-11-5.
 */
class GeneralHandler(handlerMessage: HandlerMessage?) : Handler() {

    private val handlerMessage = WeakReference(handlerMessage)

    override fun handleMessage(msg: Message?) {
        handlerMessage.get()?.onMessage(msg)
    }

    interface HandlerMessage {
        fun onMessage(msg: Message?)
    }


}